//
//  ViewAttribute.swift
//  MYModule
//
//  Created by 李然 on 2022/8/2.
//

import Foundation

public struct ViewAttribute{
    
    var widget_id = ""
    
    var back_color:String?
    var text_color:String?
    var text_size:CGFloat?
    var selected_color:String?
    var font_name:String?
    var corner_size:CGFloat?
    var image_name:String?
    var is_show_shadow:Int?
    
    var backgroundColor:UIColor?{
        guard let color = self.back_color,color.count > 0 else{
            return nil
        }
        return UIColor.init(hex: color)
    }
    
    var textColor:UIColor?{
        guard let color = self.text_color,color.count > 0 else{
            return nil
        }
        return UIColor.init(hex: color)
    }
    
    var selectedColor:UIColor?{
        guard let color = self.selected_color,color.count > 0 else{
            return nil
        }
        return UIColor.init(hex: color)
    }
}
